Accounts Management
Only accounts created through the API can be managed via the API.
Get user information
curl "https://app.sclab.io/api/1/user/get?_userId=jJpp2WfD7yp7y2cEk" \
-H "Authorization: APITokenHere" \
-H "Content-Type: application/json"
or
curl "https://app.sclab.io/api/1/user/[email protected]" \
-H "Authorization: APITokenHere" \
-H "Content-Type: application/json"
The above command returns JSON structured like this:
{
"result": {
"_userId": "jJpp2WfD7yp7y2cEk",
"email": "[email protected]",
"name": "tester",
"phone": "01012341234",
"address": "seoul"
}
}
This endpoint get user information.
HTTP Request
GET https://app.sclab.io/api/1/user/get
JSON Parameters
Parameter | Required | Description |
---|---|---|
_userId | N | User id |
N |
Create new account
curl "https://app.sclab.io/api/1/user/create" \
-X POST \
-H "Authorization: APITokenHere" \
-H "Content-Type: application/json" \
-d "{\"email\": \"[email protected]\", \"password\": \"password string\", \"name\": \"user name\"}"
The above command returns JSON structured like this:
{
"result": {
"_userId": "aspfokgwegoepwk",
"status": "user created"
}
}
This endpoint creates new site user account.
HTTP Request
POST https://app.sclab.io/api/1/user/create
JSON Parameters
Parameter | Required | Description |
---|---|---|
Y | User email address | |
password | Y | User password |
name | Y | User's name |
phone | N | User phone number |
address | N | User address |
Update account profile
curl "https://app.sclab.io/api/1/user/update" \
-X POST \
-H "Authorization: APITokenHere" \
-H "Content-Type: application/json" \
-d "{\"_userId\": \"userid\", \"name\": \"user name\"}"
The above command returns JSON structured like this:
{
"result": {
"status": "user updated"
}
}
This endpoint update site user account profile [name, phone, address, password].
HTTP Request
POST https://app.sclab.io/api/1/user/update
JSON Parameters
Parameter | Required | Description |
---|---|---|
_userId | Y | User id |
name | N | User's name |
phone | N | User phone number |
address | N | User address |
password | N | User's password |
Delete user from site
curl "https://app.sclab.io/api/1/user/delete" \
-X DELETE \
-H "Authorization: APITokenHere" \
-H "Content-Type: application/json" \
-d "{\"_userId\": \"user id\"}"
The above command returns JSON structured like this:
{
"result": {
"status": "user removed"
}
}
This endpoint remove user from your site.
HTTP Request
DELETE https://app.sclab.io/api/1/user/delete
JSON Parameters
Parameter | Required | Description |
---|---|---|
_userId | Y | User id |